/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.login.plugin.e;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import com.qihoo.gamecenter.sdk.common.b;
import com.qihoo.gamecenter.sdk.common.g.a;
import com.qihoo.gamecenter.sdk.login.plugin.a;
import com.qihoo.gamecenter.sdk.login.plugin.h.d;
import com.qihoo.gamecenter.sdk.login.plugin.h.e;
import com.qihoo.gamecenter.sdk.login.plugin.h.f;

public class c implements g.a {
    private Intent a = null;

    public void run(b paramb, Intent paramIntent) {
        this.a = paramIntent;
        e.a("Plugin.OfflineLoginLayer", new Object[] { "run entry!" });
        Activity localActivity = (Activity) paramb;
        try {
            ((com.qihoo.gamecenter.sdk.common.c) localActivity).setActivityControl(new a((b) localActivity));
        } catch (Exception localException) {
            e.b("Plugin.OfflineLoginLayer", "set control in run error!", localException);
        }
    }

    private class a extends a {
        Activity a;

        public a(b paramb) {
            super(paramb);
            this.a = ((Activity) paramb);
        }

        public void onCreateControl(Bundle paramBundle) {
            e.a("Plugin.OfflineLoginControl", new Object[] { "onCreateControl Entry!" });
            super.onCreateControl(paramBundle);
            new Handler().postDelayed(new Runnable() {
                public void run() {
                    c.a.a(c.a.this);
                }
            }, 0L);
        }

        private void b() {
            String str = "{\"data\":{\"mode\":\"offline\", \"state\":\"test_state111\",\"code\":\"\"},\"errno\":1}";
            int i = 1;
            if (c.a(c.this) != null) {
                int j = c.a(c.this).getIntExtra("function_code", -1);
                if (258 == j) {
                    str = f.a(0, "not support in offline mode");
                    i = 0;
                }
            }
            if (i != 0)
                d.b(true);
            com.qihoo.gamecenter.sdk.common.c localc = (com.qihoo.gamecenter.sdk.common.c) this.a;
            localc.execCallback(str);
            this.a.finish();
        }
    }
}